package cn.lingyangwl.agile.misc.statistic.controller;

import cn.lingyangwl.agile.misc.statistic.model.*;
import cn.lingyangwl.agile.misc.statistic.service.*;
import cn.lingyangwl.agile.tenant.core.utils.*;
import cn.lingyangwl.framework.core.response.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author shenguangyang
 */
@RestController
@RequestMapping("/testStatistic")
public class StatTestController {
    @Resource
    private StatAnalyzeService analyzeService;

    @GetMapping("/tongJi")
    public Resp<?> tongJi() {
        TenantUtils.execute("1", () -> {
            DayDimStatReq req = new DayDimStatReq();
            req.setLoginSuccessCount(1);
            analyzeService.doStatistic(req);
        });
        return Resp.ok();
    }

    @GetMapping("/tongBu")
    public Resp<?> tongBu() {
        analyzeService.syncStatistic();
        return Resp.ok();
    }
}
